package com.atguigu.gmall.cart.client;

import com.atguigu.gmall.model.cart.CartInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 购物车
 */
@FeignClient(name = "service-cart")
public interface CartFeignClient {

    //加入购物车
    @GetMapping("/api/cart/addToCart/{skuId}/{skuNum}")
    public CartInfo addToCart(
            @PathVariable(name = "skuId") Long skuId,
            @PathVariable(name = "skuNum") Integer skuNum
    );

    //查询刚刚加入的购物车
    @GetMapping("/api/cart/getCartInfo/{skuId}/{userId}")
    public CartInfo getCartInfo(@PathVariable(name = "skuId") Long skuId,
                                @PathVariable(name = "userId") String userId);

    //获取 购物车集合（选中的）
    @GetMapping("/api/cart/findCartInfoListByChecked")
    public List<CartInfo> findCartInfoListByChecked();
}
